package com.terrynoya.fight.data.parser.sff
{
	import flash.utils.Endian;
	import flash.utils.ByteArray;
	/**
	 * @author acer
	 */
	public class SFFPalNode
	{
		public var groupNo:int;
		public var itemNo:int;
		public var numCols:int;
		public var indexLink:int;
		public var offset:int;
		public var length:int;
		private var _data:ByteArray;
		
		private var _palette:Palette;
		
		public function SFFPalNode(bytes:ByteArray):void
		{
			bytes.endian = Endian.LITTLE_ENDIAN;
			groupNo = bytes.readShort();
			itemNo = bytes.readShort();
			numCols = bytes.readShort();
			indexLink = bytes.readShort();
			offset = bytes.readInt();
			length = bytes.readInt();
		}
		
		public function toString() : String 
		{
			return "groupNo:" + groupNo + "itemNo:" + itemNo + "numcols" + numCols + "indexLink" + indexLink + "offset" + offset;
		}

		public function get data() : ByteArray
		{
			return _data;
		}

		public function set data(data : ByteArray) : void
		{
			_data = data;
			this._palette = new Palette(this._data);
		}

		public function get palette() : Palette
		{
			return _palette;
		}
	}
}
